import 'dart:convert';

import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';
import 'package:enterprise_v6_app/app/data/entities/application/role_personnel_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/work_mode_config_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/ticket_plan_entity.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/execute_entity.g.dart';

///流程节点实体类
@JsonSerializable()
class ExecuteEntity {
  ExecuteEntity();

  factory ExecuteEntity.fromJson(Map<String, dynamic> json) => $ExecuteEntityFromJson(json);
  List<ExecuteFormValue>? formValue;

  /// 下一个节点的执行人 有则修改，空则不管
  List<RolePersonnelEntity>? nextNodeExecutor = [];

  /// 作业开始时间
  String? startDate = '';

  /// 作业结束时间
  String? endDate = '';

  /// 执行节点id
  String? nodeId = '';

  ///	流程唯一编码
  String? processEncoding = '';

  /// 作业票id
  String? ticketReceiptId = '';

  /// 当前选择的执行节点
  int selectIndex = 0;

  /// 当前进行节点的路由
  String specialJobCode = '';

  /// 运行时模板id
  String? rtemplateId;

  ///	气体分析结果文件
  List<String>? gasUrl = [];

  ///安全交底节点
  List<ExecuteTicketDiscloseList>? ticketDiscloseList = [];

  ///气体分析节点
  List<ExecuteTicketGasList>? ticketGasList = [];

  ///作业申请节点
  ExecuteTicketReceiptList? ticketReceiptList = ExecuteTicketReceiptList();

  ///作业关闭节点
  ExecuteWorkCheckList? workCheckList = ExecuteWorkCheckList();

  ///作业审批节点
  List<ExecuteWorkCheckList>? workCheckLists = [];

  ///	安全措施节点
  List<ExecuteWorkSafetyMeasuresList>? workSafetyMeasuresList = [];

  /// 作业相关人员列表
  List<ExecuteTicketReceiptListOperatorLists>? operatorLists = [];

  Map<String, dynamic> toJson() => $ExecuteEntityToJson(this);

  ExecuteEntity copyWith(
      {List<ExecuteFormValue>? formValue,
      List<RolePersonnelEntity>? nextNodeExecutor,
      String? nodeId,
      String? processEncoding,
      String? rtemplateId,
      List<ExecuteTicketDiscloseList>? ticketDiscloseList,
      List<ExecuteTicketGasList>? ticketGasList,
      ExecuteTicketReceiptList? ticketReceiptList,
      ExecuteWorkCheckList? workCheckList,
      List<ExecuteWorkCheckList>? workCheckLists,
      List<String>? gasUrl,
      String? startDate,
      String? endDate,
      List<ExecuteWorkSafetyMeasuresList>? workSafetyMeasuresList}) {
    return ExecuteEntity()
      ..formValue = formValue ?? this.formValue
      ..nextNodeExecutor = nextNodeExecutor ?? this.nextNodeExecutor
      ..nodeId = nodeId ?? this.nodeId
      ..processEncoding = processEncoding ?? this.processEncoding
      ..rtemplateId = rtemplateId ?? this.rtemplateId
      ..ticketDiscloseList = ticketDiscloseList ?? this.ticketDiscloseList
      ..ticketGasList = ticketGasList ?? this.ticketGasList
      ..ticketReceiptList = ticketReceiptList ?? this.ticketReceiptList
      ..workCheckList = workCheckList ?? this.workCheckList
      ..workCheckLists = workCheckLists ?? this.workCheckLists
      ..gasUrl = gasUrl ?? this.gasUrl
      ..workSafetyMeasuresList = workSafetyMeasuresList ?? this.workSafetyMeasuresList
      ..startDate = startDate ?? this.startDate
      ..endDate = endDate ?? this.endDate;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ExecuteFormValue {
  ExecuteFormValue();

  factory ExecuteFormValue.fromJson(Map<String, dynamic> json) => $ExecuteFormValueFromJson(json);
  String? businessDataId = '';
  String? companyCode = '';
  String? createBy = '';
  String? createDate = '';
  String? dictionaryTableId = '';
  String? id = '';
  String? label = '';
  String? name = '';
  String? nodeId = '';
  String? processEncoding = '';
  String? updateBy = '';
  String? updateDate = '';
  String? value = '';

  Map<String, dynamic> toJson() => $ExecuteFormValueToJson(this);

  ExecuteFormValue copyWith(
      {String? businessDataId,
      String? companyCode,
      String? createBy,
      String? createDate,
      String? dictionaryTableId,
      String? id,
      String? label,
      String? name,
      String? nodeId,
      String? processEncoding,
      String? updateBy,
      String? updateDate,
      String? value}) {
    return ExecuteFormValue()
      ..businessDataId = businessDataId ?? this.businessDataId
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..dictionaryTableId = dictionaryTableId ?? this.dictionaryTableId
      ..id = id ?? this.id
      ..label = label ?? this.label
      ..name = name ?? this.name
      ..nodeId = nodeId ?? this.nodeId
      ..processEncoding = processEncoding ?? this.processEncoding
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate
      ..value = value ?? this.value;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///安全交底节点
@JsonSerializable()
class ExecuteTicketDiscloseList {
  ExecuteTicketDiscloseList();

  factory ExecuteTicketDiscloseList.fromJson(Map<String, dynamic> json) =>
      $ExecuteTicketDiscloseListFromJson(json);

  ///	企业编码
  String? companyCode = '';

  ///	创建人
  String? createBy = '';

  ///	创建时间
  String? createDate = '';

  ///	交底时间
  String? discloseDate = '';

  ///	附件（文件）
  List<String>? discloseFile = [];

  /// 交底类型 0：安全交底人 1：接受交底人 2：监护人
  int? discloseType = 0;

  ///	交底人用户ID
  String? discloseUserId = '';

  ///	交底人用户名
  String? discloseUserName = '';

  ///	交底人签名
  List<String>? discloseUserSign = [];

  ///	视频
  String? discloseVideo = '';

  ///	主键ID
  String? id = '';

  ///	作业计划ID
  String? ticketPlanId = '';

  ///	作业票ID
  String? ticketReceiptId = '';

  ///	修改人
  String? updateBy = '';

  ///	修改时间
  String? updateDate = '';

  Map<String, dynamic> toJson() => $ExecuteTicketDiscloseListToJson(this);

  ExecuteTicketDiscloseList copyWith(
      {String? companyCode,
      String? createBy,
      String? createDate,
      String? discloseDate,
      List<String>? discloseFile,
      int? discloseType,
      String? discloseUserId,
      String? discloseUserName,
      List<String>? discloseUserSign,
      String? discloseVideo,
      String? id,
      String? ticketPlanId,
      String? ticketReceiptId,
      String? updateBy,
      String? updateDate}) {
    return ExecuteTicketDiscloseList()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..discloseDate = discloseDate ?? this.discloseDate
      ..discloseFile = discloseFile ?? this.discloseFile
      ..discloseType = discloseType ?? this.discloseType
      ..discloseUserId = discloseUserId ?? this.discloseUserId
      ..discloseUserName = discloseUserName ?? this.discloseUserName
      ..discloseUserSign = discloseUserSign ?? this.discloseUserSign
      ..discloseVideo = discloseVideo ?? this.discloseVideo
      ..id = id ?? this.id
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///气体分析节点
@JsonSerializable()
class ExecuteTicketGasList {
  ExecuteTicketGasList();

  factory ExecuteTicketGasList.fromJson(Map<String, dynamic> json) => $ExecuteTicketGasListFromJson(json);

  /// 企业编码
  String? companyCode = '';

  ///	创建人
  String? createBy = '';

  ///	创建时间
  String? createDate = '';

  ///	主键ID
  String? id = '';

  ///	取样分析时间
  String? sampleDate = '';

  ///	取样方式 0：现场取样 1：接入设备
  int? sampleType = 0;

  ///	取样人ID
  String? sampleUserId = '';

  ///	取样人姓名
  String? sampleUserName = '';

  ///	取样人签字
  List<String>? sampleUserSign = [];

  ///	作业计划ID
  String? ticketPlanId = '';

  ///	作业票ID
  String? ticketReceiptId = '';

  ///	修改人
  String? updateBy = '';

  ///	修改时间
  String? updateDate = '';

  /// 分析点名称
  String? addressName = '';

  ///	气体分析结果文件
  List<String>? gasUrl = [];

  ///	作业气体分析详情
  List<ExecuteTicketGasListWorkGasJsonDTOList>? workGasJsonDTOList = [];

  /// 是否是新数据,新数据才可以编辑
  bool isNewData = false;

  Map<String, dynamic> toJson() => $ExecuteTicketGasListToJson(this);

  ExecuteTicketGasList copyWith(
      {String? companyCode,
      String? createBy,
      String? createDate,
      String? id,
      String? sampleDate,
      int? sampleType,
      String? sampleUserId,
      String? sampleUserName,
      List<String>? sampleUserSign,
      String? ticketPlanId,
      String? ticketReceiptId,
      String? updateBy,
      String? updateDate,
      String? addressName,
      bool? isNewData,
      List<String>? gasUrl,
      List<ExecuteTicketGasListWorkGasJsonDTOList>? workGasJsonDTOList}) {
    return ExecuteTicketGasList()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..sampleDate = sampleDate ?? this.sampleDate
      ..sampleType = sampleType ?? this.sampleType
      ..sampleUserId = sampleUserId ?? this.sampleUserId
      ..sampleUserName = sampleUserName ?? this.sampleUserName
      ..sampleUserSign = sampleUserSign ?? this.sampleUserSign
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate
      ..addressName = addressName ?? this.addressName
      ..gasUrl = gasUrl ?? this.gasUrl
      ..isNewData = isNewData ?? this.isNewData
      ..workGasJsonDTOList = workGasJsonDTOList ?? this.workGasJsonDTOList;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///	作业气体分析详情
@JsonSerializable()
class ExecuteTicketGasListWorkGasJsonDTOList {
  ExecuteTicketGasListWorkGasJsonDTOList();

  factory ExecuteTicketGasListWorkGasJsonDTOList.fromJson(Map<String, dynamic> json) =>
      $ExecuteTicketGasListWorkGasJsonDTOListFromJson(json);

  ///	气体名称
  String? gasName = '';

  // ///	气体合格范围结束值
  // int? gasQualifiedEnd = 0;

  ///	气体合格标准
  String? gasQualified = '';

  ///	气体分析结果
  String? gasResult = '';

  ///	气体类型字典ID
  String? gasTypeId = '';

  /// 气体类型字典名称
  String? gasTypeName = '';

  Map<String, dynamic> toJson() => $ExecuteTicketGasListWorkGasJsonDTOListToJson(this);

  ExecuteTicketGasListWorkGasJsonDTOList copyWith(
      {String? gasName,
      // int? gasQualifiedEnd,
      String? gasQualified,
      String? gasResult,
      String? gasTypeId,
      String? gasTypeName}) {
    return ExecuteTicketGasListWorkGasJsonDTOList()
      ..gasName = gasName ?? this.gasName
      ..gasResult = gasResult ?? this.gasResult
      ..gasTypeId = gasTypeId ?? this.gasTypeId
      ..gasTypeName = gasTypeName ?? this.gasTypeName;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///作业申请节点
@JsonSerializable()
class ExecuteTicketReceiptList {
  ExecuteTicketReceiptList();

  factory ExecuteTicketReceiptList.fromJson(Map<String, dynamic> json) =>
      $ExecuteTicketReceiptListFromJson(json);

  /// 异常类型[数组] 0：管理异常 1：开票异常 2：气体异常 3：其他异常
  List<String>? abnormalType = [];

  ///	申请人ID
  String? applyUserId = '';

  ///	申请人姓名
  String? applyUserName = '';

  ///	企业编码
  String? companyCode = '';

  /// 创建人
  String? createBy = '';

  ///	创建时间
  String? createDate = '';

  ///	作业申请时间
  String? applyDate = '';

  ///	作业结束时间
  String? endDate = '';

  ///	气体分析结果文件
  List<String>? gasUrl = [];

  ///	监护人ID
  String? guardianUserId = '';

  ///	监护人姓名
  String? guardianUserName = '';

  ///	主键ID
  String? id = '';

  /// 作业相关人员列表
  List<ExecuteTicketReceiptListOperatorLists>? operatorLists = [];

  /// 其他信息
  String? otherData = '';

  /// 其他作业编号[数组]
  List<String>? otherTicketNo = [];

  ///	流转状态
  String? processType = '';

  ///	作业开始时间
  String? startDate = '';

  ///	作业大类字典值
  String? ticketBigType = '';

  ///	作业大类字典ID
  String? ticketBigTypeId = '';

  ///	作业大类字典名称
  String? ticketBigTypeName = '';

  ///	作业计划ID
  String? ticketPlanId = '';

  ///	作业细类字典ID
  String? ticketTypeId = '';

  ///	作业细类字典名称
  String? ticketTypeName = '';

  ///	作业状态 0：待开票 1：开票中 2：进行中 3：中断 4：已验收 5：撤销 6:作废
  int? type = 0;

  ///	修改人
  String? updateBy = '';

  ///	修改时间
  String? updateDate = '';

  ///	作业单位ID
  String? workDepartmentId = '';

  ///	作业单位名称
  String? workDepartmentName = '';

  ///	作业单位类型 0：内部 1：第三方
  int? workDepartmentType = 0;

  ///	其他作业信息
  ExecuteTicketReceiptListWorkOtherDataDTO? workOtherDataDTO = ExecuteTicketReceiptListWorkOtherDataDTO();

  ///	作业方案
  List<String>? workPlan = [];

  ///作业计划信息
  TicketPlanEntity? ticketPlanList = TicketPlanEntity();

  ///作业小票编号(作业编号）
  String? receiptNo = '';

  /// 视频地址集合
  List<String> liveVideoUrl = [];

  ///是否选中
  bool? isChecked = false;

  String getId() {
    return id!;
  }

  bool getIsChecked() {
    return isChecked!;
  }

  String getShowName() {
    return receiptNo!;
  }

  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }

  Map<String, dynamic> toJson() => $ExecuteTicketReceiptListToJson(this);

  ExecuteTicketReceiptList copyWith(
      {String? applyUserId,
      String? applyUserName,
      String? applyDate,
      String? companyCode,
      String? createBy,
      String? createDate,
      String? endDate,
      String? id,
      List<ExecuteTicketReceiptListOperatorLists>? operatorLists,
      String? otherData,
      List<String>? otherTicketNo,
      String? processType,
      String? startDate,
      String? ticketBigType,
      String? ticketBigTypeId,
      String? ticketBigTypeName,
      String? ticketPlanId,
      String? ticketTypeId,
      String? ticketTypeName,
      int? type,
      String? updateBy,
      String? updateDate,
      String? workDepartmentId,
      String? workDepartmentName,
      int? workDepartmentType,
      ExecuteTicketReceiptListWorkOtherDataDTO? workOtherDataDTO,
      List<String>? workPlan,
      List<String>? abnormalType,
      List<String>? gasUrl,
      String? receiptNo,
      TicketPlanEntity? ticketPlanList}) {
    return ExecuteTicketReceiptList()
      ..applyUserId = applyUserId ?? this.applyUserId
      ..applyDate = applyDate ?? this.applyDate
      ..applyUserName = applyUserName ?? this.applyUserName
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..endDate = endDate ?? this.endDate
      ..id = id ?? this.id
      ..operatorLists = operatorLists ?? this.operatorLists
      ..otherData = otherData ?? this.otherData
      ..otherTicketNo = otherTicketNo ?? this.otherTicketNo
      ..processType = processType ?? this.processType
      ..startDate = startDate ?? this.startDate
      ..ticketBigType = ticketBigType ?? this.ticketBigType
      ..ticketBigTypeId = ticketBigTypeId ?? this.ticketBigTypeId
      ..ticketBigTypeName = ticketBigTypeName ?? this.ticketBigTypeName
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketTypeId = ticketTypeId ?? this.ticketTypeId
      ..ticketTypeName = ticketTypeName ?? this.ticketTypeName
      ..type = type ?? this.type
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate
      ..workDepartmentId = workDepartmentId ?? this.workDepartmentId
      ..workDepartmentName = workDepartmentName ?? this.workDepartmentName
      ..workOtherDataDTO = workOtherDataDTO ?? this.workOtherDataDTO
      ..workPlan = workPlan ?? this.workPlan
      ..receiptNo = receiptNo ?? this.receiptNo
      ..abnormalType = abnormalType ?? this.abnormalType
      ..gasUrl = gasUrl ?? this.gasUrl
      ..workDepartmentType = workDepartmentType ?? this.workDepartmentType
      ..ticketPlanList = ticketPlanList ?? this.ticketPlanList;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///作业相关人员
@JsonSerializable()
class ExecuteTicketReceiptListOperatorLists implements ChoiceBean {
  ExecuteTicketReceiptListOperatorLists();

  factory ExecuteTicketReceiptListOperatorLists.fromJson(Map<String, dynamic> json) =>
      $ExecuteTicketReceiptListOperatorListsFromJson(json);

  ///	企业编码
  String? companyCode = '';

  ///创建人
  String? createBy = '';

  ///创建时间
  String? createDate = '';

  ///	主键ID
  String? id = '';

  ///	操作人证书ID
  String? operatorCertificateId = '';

  ///作业人类型 0：作业实施人 1：作业负责人 2：监护人 3:编制人 4：司索人 5:指挥人 6：用电人 7：安全交底人 8：接受交底人 9：验收人
  int? operatorType = 0;

  ///作业人ID
  String? operatorUserId = '';

  ///作业人名称
  String? operatorUserName = '';

  ///作业人签字
  String? operatorUserSign = '';

  ///作业计划ID
  String? ticketPlanId = '';

  ///	作业票ID
  String? ticketReceiptId = '';

  ///	修改人
  String? updateBy = '';

  /// 修改时间
  String? updateDate = '';

  /// 作业人类型中文
  String operatorName = '';

  /// 记录是否为交接班数据 null或0为正常数据,1为正在交接班数据,交接数据可以进行编辑
  int? number = 0;

  /// 是否选中
  bool isChecked = false;

  @override
  String getId() {
    return operatorUserId!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  String getShowName() {
    return operatorUserName!;
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }

  Map<String, dynamic> toJson() => $ExecuteTicketReceiptListOperatorListsToJson(this);

  ExecuteTicketReceiptListOperatorLists copyWith(
      {String? companyCode,
      String? createBy,
      String? createDate,
      String? id,
      String? operatorCertificateId,
      int? operatorType,
      int? number,
      String? operatorUserId,
      String? operatorUserName,
      String? operatorUserSign,
      String? ticketPlanId,
      String? ticketReceiptId,
      String? updateBy,
      String? operatorName,
      String? updateDate}) {
    return ExecuteTicketReceiptListOperatorLists()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..operatorCertificateId = operatorCertificateId ?? this.operatorCertificateId
      ..operatorType = operatorType ?? this.operatorType
      ..number = number ?? this.number
      ..operatorUserId = operatorUserId ?? this.operatorUserId
      ..operatorUserName = operatorUserName ?? this.operatorUserName
      ..operatorUserSign = operatorUserSign ?? this.operatorUserSign
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..operatorName = operatorName ?? this.operatorName
      ..updateDate = updateDate ?? this.updateDate;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///	其他作业信息
@JsonSerializable()
class ExecuteTicketReceiptListWorkOtherDataDTO {
  ExecuteTicketReceiptListWorkOtherDataDTO();

  factory ExecuteTicketReceiptListWorkOtherDataDTO.fromJson(Map<String, dynamic> json) =>
      $ExecuteTicketReceiptListWorkOtherDataDTOFromJson(json);

  ///	盲板位置图及编号
  List<String>? blindPlatePosition = [];

  ///	受限空间内原有介质名称
  String? confinedSpaceMediumName = '';

  ///	受限空间名称
  String? confinedSpaceName = '';

  /// 涉及相关单位信息
  List<Involve>? involveList = [];

  ///	作业人高度
  String? operatorHeight = '';

  ///	作业高度级别
  String? heightLevel = '';

  ///	用电设备名称
  String? powerAccessDeviceName = '';

  ///	用电设备功率
  String? powerAccessDevicePower = '';

  ///	电源接入点
  String? powerAccessPoint = '';

  ///	许可用电功率
  String? powerAccessPower = '';

  ///	工作电压
  String? powerAccessVoltage = '';

  ///	断路地段示意图
  List<String>? powerOffMapUrl = [];

  ///	签字
  List<String>? sign = [];

  ///	签字时间
  String? signTime = '';

  ///	断路原因
  String? powerOffReason = '';

  ///	断路地段相关说明
  String? powerOffRemark = '';

  ///	简图
  List<String>? simpleMapUrl = [];

  ///	吊具名称
  String? slingName = '';

  ///	吊物质量（t）
  String? slingWeight = '';

  ///	作业面积
  String? workArea = '';

  ///	作业深度
  String? workDepth = '';

  ///	纬度
  double? latitude = 0;

  /// 经度
  double? longitude = 0;

  /// 作业地点
  String? otherTicketAddress = '';

  /// 盲板作业类别
  String? blindPlateType = '';

  // ///	动火方式ID
  // String? workModeId = '';
  //
  // ///	动火方式名称
  // String? workModeName = '';

  ///动火方式
  List<WorkModeConfigEntity>? workModeConfigs = [];

  ///	动火地点及动火部位
  String? workPlace = '';

  ///	设备管道数据
  ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO? workPiPingDTO =
      ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO();

  Map<String, dynamic> toJson() => $ExecuteTicketReceiptListWorkOtherDataDTOToJson(this);

  ExecuteTicketReceiptListWorkOtherDataDTO copyWith(
      {List<String>? blindPlatePosition,
      String? confinedSpaceMediumName,
      String? confinedSpaceName,
      List<Involve>? involveList,
      String? operatorHeight,
      String? heightLevel,
      String? powerAccessDeviceName,
      String? powerAccessDevicePower,
      String? powerAccessPoint,
      String? powerAccessPower,
      String? powerAccessVoltage,
      List<String>? powerOffMapUrl,
      List<String>? sign,
      String? powerOffReason,
      String? signTime,
      String? powerOffRemark,
      List<String>? simpleMapUrl,
      String? slingName,
      String? slingWeight,
      String? workArea,
      String? workDepth,
      List<WorkModeConfigEntity>? workModeConfigs,
      String? workPlace,
      double? latitude,
      double? longitude,
      String? otherTicketAddress,
      String? blindPlateType,
      ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO? workPiPingDTO}) {
    return ExecuteTicketReceiptListWorkOtherDataDTO()
      ..blindPlatePosition = blindPlatePosition ?? this.blindPlatePosition
      ..confinedSpaceMediumName = confinedSpaceMediumName ?? this.confinedSpaceMediumName
      ..confinedSpaceName = confinedSpaceName ?? this.confinedSpaceName
      ..involveList = involveList ?? this.involveList
      ..operatorHeight = operatorHeight ?? this.operatorHeight
      ..heightLevel = heightLevel ?? this.heightLevel
      ..powerAccessDeviceName = powerAccessDeviceName ?? this.powerAccessDeviceName
      ..powerAccessDevicePower = powerAccessDevicePower ?? this.powerAccessDevicePower
      ..powerAccessPoint = powerAccessPoint ?? this.powerAccessPoint
      ..powerAccessPower = powerAccessPower ?? this.powerAccessPower
      ..powerAccessVoltage = powerAccessVoltage ?? this.powerAccessVoltage
      ..powerOffMapUrl = powerOffMapUrl ?? this.powerOffMapUrl
      ..sign = sign ?? this.sign
      ..powerOffReason = powerOffReason ?? this.powerOffReason
      ..signTime = signTime ?? this.signTime
      ..powerOffRemark = powerOffRemark ?? this.powerOffRemark
      ..simpleMapUrl = simpleMapUrl ?? this.simpleMapUrl
      ..slingName = slingName ?? this.slingName
      ..slingWeight = slingWeight ?? this.slingWeight
      ..workArea = workArea ?? this.workArea
      ..workDepth = workDepth ?? this.workDepth
      ..workModeConfigs = workModeConfigs ?? this.workModeConfigs
      ..workPlace = workPlace ?? this.workPlace
      ..latitude = latitude ?? this.latitude
      ..longitude = longitude ?? this.longitude
      ..otherTicketAddress = otherTicketAddress ?? this.otherTicketAddress
      ..blindPlateType = blindPlateType ?? this.blindPlateType
      ..workPiPingDTO = workPiPingDTO ?? this.workPiPingDTO;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///	涉及相关单位
@JsonSerializable()
class Involve {
  Involve();

  factory Involve.fromJson(Map<String, dynamic> json) => $InvolveFromJson(json);

  ///涉及相关单位ID
  String? involveUnitId = '';

  ///涉及相关单位名称
  String? involveUnitName = '';

  Map<String, dynamic> toJson() => $InvolveToJson(this);

  Involve copyWith({
    String? involveUnitId,
    String? involveUnitName,
  }) {
    return Involve()
      ..involveUnitId = involveUnitId ?? this.involveUnitId
      ..involveUnitName = involveUnitName ?? this.involveUnitName;
  }
}

///	设备管道数据
@JsonSerializable()
class ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO {
  ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO();

  factory ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO.fromJson(Map<String, dynamic> json) =>
      $ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTOFromJson(json);

  ///	盲板材质
  String? blindPlateMaterial = '';

  /// 盲板编号
  String? blindPlateNumber = '';

  ///	盲板规格
  String? blindPlateSpecification = '';

  ///	管道介质
  String? pipeMedium = '';

  ///	管道名称
  String? pipeName = '';

  ///	管道压力
  String? pipePressure = '';

  ///	管道温度
  String? pipeTemperature = '';

  Map<String, dynamic> toJson() => $ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTOToJson(this);

  ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO copyWith(
      {String? blindPlateMaterial,
      String? blindPlateNumber,
      String? blindPlateSpecification,
      String? pipeMedium,
      String? pipeName,
      String? pipePressure,
      String? pipeTemperature}) {
    return ExecuteTicketReceiptListWorkOtherDataDTOWorkPiPingDTO()
      ..blindPlateMaterial = blindPlateMaterial ?? this.blindPlateMaterial
      ..blindPlateNumber = blindPlateNumber ?? this.blindPlateNumber
      ..blindPlateSpecification = blindPlateSpecification ?? this.blindPlateSpecification
      ..pipeMedium = pipeMedium ?? this.pipeMedium
      ..pipeName = pipeName ?? this.pipeName
      ..pipePressure = pipePressure ?? this.pipePressure
      ..pipeTemperature = pipeTemperature ?? this.pipeTemperature;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///作业审批节点
@JsonSerializable()
class ExecuteWorkCheckList {
  ExecuteWorkCheckList();

  factory ExecuteWorkCheckList.fromJson(Map<String, dynamic> json) => $ExecuteWorkCheckListFromJson(json);

  /// 审批时间
  String? checkDate = '';

  ///	审核照片
  List<String>? checkImage = [];

  ///	审批项
  String? checkProject = '';

  ///	审核意见
  String? checkReason = '';

  ///	审核用户ID
  String? checkUserId = '';

  ///	审核用户姓名
  String? checkUserName = '';

  ///	审核用户签名
  List<String>? checkUserSign = [];

  ///	企业编码
  String? companyCode = '';

  ///	创建人
  String? createBy = '';

  ///	创建时间
  String? createDate = '';

  ///	主键ID
  String? id = '';

  ///	作业计划ID
  String? ticketPlanId = '';

  /// 作业票ID
  String? ticketReceiptId = '';

  ///	修改人
  String? updateBy = '';

  ///	修改时间
  String? updateDate = '';

  ///排序
  int? sort = 0;

  Map<String, dynamic> toJson() => $ExecuteWorkCheckListToJson(this);

  ExecuteWorkCheckList copyWith(
      {String? checkDate,
      List<String>? checkImage,
      String? checkProject,
      String? checkReason,
      String? checkUserId,
      String? checkUserName,
      List<String>? checkUserSign,
      String? companyCode,
      String? createBy,
      String? createDate,
      String? id,
      String? ticketPlanId,
      String? ticketReceiptId,
      String? updateBy,
      int? sort,
      String? updateDate}) {
    return ExecuteWorkCheckList()
      ..checkDate = checkDate ?? this.checkDate
      ..checkImage = checkImage ?? this.checkImage
      ..checkProject = checkProject ?? this.checkProject
      ..checkReason = checkReason ?? this.checkReason
      ..checkUserId = checkUserId ?? this.checkUserId
      ..checkUserName = checkUserName ?? this.checkUserName
      ..checkUserSign = checkUserSign ?? this.checkUserSign
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..sort = sort ?? this.sort
      ..updateDate = updateDate ?? this.updateDate;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///作业审批节点
@JsonSerializable()
class ExecuteWorkCheckLists {
  ExecuteWorkCheckLists();

  factory ExecuteWorkCheckLists.fromJson(Map<String, dynamic> json) => $ExecuteWorkCheckListsFromJson(json);

  /// 审批时间
  String? checkDate = '';

  ///	审核照片
  String? checkImage = '';

  ///	审批项
  String? checkProject = '';

  ///	审核意见
  String? checkReason = '';

  ///	审核用户ID
  String? checkUserId = '';

  ///	审核用户姓名
  String? checkUserName = '';

  ///	审核用户签名
  String? checkUserSign = '';

  ///	企业编码
  String? companyCode = '';

  ///	创建人
  String? createBy = '';

  ///	创建时间
  String? createDate = '';

  ///	主键ID
  String? id = '';

  ///	作业计划ID
  String? ticketPlanId = '';

  /// 作业票ID
  String? ticketReceiptId = '';

  ///	修改人
  String? updateBy = '';

  ///	修改时间
  String? updateDate = '';

  Map<String, dynamic> toJson() => $ExecuteWorkCheckListsToJson(this);

  ExecuteWorkCheckLists copyWith(
      {String? checkDate,
      String? checkImage,
      String? checkProject,
      String? checkReason,
      String? checkUserId,
      String? checkUserName,
      String? checkUserSign,
      String? companyCode,
      String? createBy,
      String? createDate,
      String? id,
      String? ticketPlanId,
      String? ticketReceiptId,
      String? updateBy,
      String? updateDate}) {
    return ExecuteWorkCheckLists()
      ..checkDate = checkDate ?? this.checkDate
      ..checkImage = checkImage ?? this.checkImage
      ..checkProject = checkProject ?? this.checkProject
      ..checkReason = checkReason ?? this.checkReason
      ..checkUserId = checkUserId ?? this.checkUserId
      ..checkUserName = checkUserName ?? this.checkUserName
      ..checkUserSign = checkUserSign ?? this.checkUserSign
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

///安全措施节点
@JsonSerializable()
class ExecuteWorkSafetyMeasuresList {
  ExecuteWorkSafetyMeasuresList();

  factory ExecuteWorkSafetyMeasuresList.fromJson(Map<String, dynamic> json) =>
      $ExecuteWorkSafetyMeasuresListFromJson(json);

  ///	企业编码
  String? companyCode = '';

  ///	管控手段字典表ID
  String? controlMeansId = '';

  ///	管控手段名称
  String? controlMeansName = '';

  ///	管控节点字典表id
  String? controlPointId = '';

  ///	管控节点名称
  String? controlPointName = '';

  ///	管控权限字典表id
  String? controlAuthId = '';

  ///	管控权限名称
  String? controlAuthName = '';

  ///	创建人
  String? createBy = '';

  /// 创建时间
  String? createDate = '';

  ///	主键ID
  String? id = '';

  ///	是否涉及 0：未涉及 1：涉及
  int? isInvolve = 0;

  ///	安全措施
  String? safetyMeasures = '';

  ///	安全措施配置ID
  String? safetyMeasuresId = '';

  ///	作业计划ID
  String? ticketPlanId = '';

  ///	作业票ID
  String? ticketReceiptId = '';

  ///	修改人
  String? updateBy = '';

  ///	修改时间
  String? updateDate = '';

  /// 编制人签字
  List<String>? preparedSign = [];

  ///	用户签字
  List<String>? userSign = [];

  /// 照片
  List<String>? images = [];

  /// 排序
  String? workSort = '';

  Map<String, dynamic> toJson() => $ExecuteWorkSafetyMeasuresListToJson(this);

  ExecuteWorkSafetyMeasuresList copyWith(
      {String? companyCode,
      String? controlMeansId,
      String? controlMeansName,
      String? createBy,
      String? createDate,
      String? id,
      int? isInvolve,
      String? safetyMeasures,
      String? safetyMeasuresId,
      String? ticketPlanId,
      String? ticketReceiptId,
      String? updateBy,
      String? updateDate,
      String? workSort,
      String? controlPointId,
      String? controlPointName,
      String? controlAuthId,
      String? controlAuthName,
      List<String>? preparedSign,
      List<String>? userSign,
      List<String>? images}) {
    return ExecuteWorkSafetyMeasuresList()
      ..companyCode = companyCode ?? this.companyCode
      ..controlMeansId = controlMeansId ?? this.controlMeansId
      ..controlMeansName = controlMeansName ?? this.controlMeansName
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..isInvolve = isInvolve ?? this.isInvolve
      ..safetyMeasures = safetyMeasures ?? this.safetyMeasures
      ..safetyMeasuresId = safetyMeasuresId ?? this.safetyMeasuresId
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate
      ..workSort = workSort ?? this.workSort
      ..controlPointId = controlPointId ?? this.controlPointId
      ..controlPointName = controlPointName ?? this.controlPointName
      ..controlAuthId = controlAuthId ?? this.controlAuthId
      ..controlAuthName = controlAuthName ?? this.controlAuthName
      ..preparedSign = preparedSign ?? this.preparedSign
      ..userSign = userSign ?? this.userSign
      ..images = images ?? this.images;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}
